In [1]:
%matplotlib inline 
%load_ext autoreload
%autoreload 2
%config InlineBackend.figure_format = 'retina' # I use a HiDPI screen

In [2]:
from plot_derived_parameters.plot_function import *

In [3]:
# load in the data
chainLocation = "analysis/chains/"
planck2015Data = loadChainFolder( 'plot_derived_parameters/chains/CDI_2/' )


/home/zequnl/anaconda3/lib/python3.6/site-packages/astropy/table/table.py:2622: FutureWarning: elementwise == comparison failed and returning scalar instead; this will raise an error or perform elementwise comparison in the future.
  result = self.as_array() == other

In [4]:
# take a look at what is in this table
planck2015Data.colnames


Out[4]:
['acceptance',
 'likelihood',
 'omega_b',
 'omega_cdm',
 '100theta_s',
 'tau_reio',
 'P_{RR}^1',
 'P_{RR}^2',
 'P_{II}^1',
 'P_{II}^2',
 'P_{RI}^1',
 'A_planck']

In [18]:
# determine 95% percentile isocurvature power 
# (I'm using P_II^2, you could use some other choice)
quantity = planck2015Data["P_{II}^2"]
plt.hist(quantity)
upper_95 = np.percentile(quantity, 95)
plt.xlabel(r"$P_{II}^2$")
plt.axvline(upper_95, color="red", label="95%")
plt.legend()
# plt.yscale("log")


Out[18]:
<matplotlib.legend.Legend at 0x7fd1b878d4a8>

In [19]:
# filter by this large isocurvature fraction and get the maximum likelihood sample
filtered = planck2015Data[quantity > upper_95]
filtered[ np.argmax(-filtered["likelihood"]) ]


Out[19]:
Row index=1492
acceptancelikelihoodomega_bomega_cdm100theta_stau_reioP_{RR}^1P_{RR}^2P_{II}^1P_{II}^2P_{RI}^1A_planck
int64float64float64float64float64float64float64float64float64float64float64float64
275356.332.2352340.11841311.0414190.070008482.39496e-092.092462e-092.39416e-127.096496e-09-4.217695e-12100.0804

In [ ]:


In [ ]: